using Blog.web.Models;
using Microsoft.AspNetCore.Mvc;

namespace Blog.web.Controllers;
public class KongController:Controller
{
    // 渲染复杂数据到页面
    public IActionResult Index(){
        var obj=new Students
        {
            StudentName="丸子",
            Sex="女",
            Age=18
        };
        return View(obj);
        
    }

    //  渲染（展示）包含集合数据的对象数据到视图
    public IActionResult Index_2()
    {
        var list=new List<BlogCreateDao>()
        {
           new BlogCreateDao
           {
                Title="Cao!装逼飞起来",
                Author="小猪",
                Content="嘿嘿额",
            },
                 new BlogCreateDao
           {
                Title="Cao!装逼飞起来",
                Author="小猪",
                Content="嘿嘿额",
            },
                 new BlogCreateDao
           {
                Title="Cao!装逼飞起来",
                Author="小猪",
                Content="嘿嘿额",
            },
                 new BlogCreateDao
           {
                Title="Cao!装逼飞起来",
                Author="小猪",
                Content="嘿嘿额",
            }
        };
        return View(list);
    }

    // 尝试构建如下图所示的经典CRUD列表
    public IActionResult Index_3()
    {        var list =new List<Blos>
             {
                 new Blos
                 {
                    ID=1,
                     Top="啊哈哈",
                     Cont="两个哈",
                     Name="小猪",
                 },
                  new Blos
                 {
                    ID=2,
                     Top="啊嘿嘿",
                     Cont="两个嘿",
                     Name="丸子",
                 },
                  new Blos
                 {
                    ID=3,
                     Top="啊嘻嘻",
                     Cont="两个嘻",
                     Name="丸子猪",
                 },
                  new Blos
                 {
                    ID=4,
                     Top="啊桀桀",
                     Cont="两个桀",
                     Name="猪肉丸子",
                 },
                   new Blos
                 {
                    ID=5,
                     Top="啊呵呵",
                     Cont="两个呵",
                     Name="18岁暴龙战士",
                 },
                        new Blos
                 {
                    ID=6,
                     Top="啊靠靠",
                     Cont="两个靠",
                     Name="21岁俏寡妇",
                 },
                        new Blos
                 {
                    ID=7,
                     Top="啊淦淦",
                     Cont="两个淦",
                     Name="24岁性感后妈",
                 },
             };
      

            return View(list);
        
    }

     public IActionResult Add()
    {
        return View();
    }
    public IActionResult Edit()
    {
        return View();
    }
    public IActionResult Delete()
    {
        return View();
    }

}